﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace SWCInvoice.Utils.Bindingconverter {
    class BooleanToImage : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            string filename = "";
            try {
                Utils.IdentifierState x = (Utils.IdentifierState)value;
                if (x == Utils.IdentifierState.Identifier) {
                    filename = @"icons\gui\hasIdentifier.png";
                } else if (x == Utils.IdentifierState.IdentifierInheritance) {
                    filename = @"icons\gui\hasIdentifierInheritance.png";
                } else if (x == Utils.IdentifierState.None) {
                    filename = @"icons\gui\hasNoIdentifier.png";
                }
            } catch (Exception) {
            }
            return filename;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            return value;
        }
    }
}
